﻿using System;
using System.Collections.Generic;

namespace T.FAS.Runtime.Base.Entity
{
    /// <summary>
    /// 行为结果项结构
    /// </summary>
    public class ViewModelItemSchema
    {
        public string ViewModelItemCode { get; set; }
        public string ViewModelItemName { get; set; }
        public ViewModelItemSchema()
        {
            Properties = new List<ViewModelItemProperty>();
        }

        public ViewModelItemRelation Relation { get; set; }
        public void AddProperty(ViewModelItemProperty property)
        {
            if (Properties.Exists(p => p.ViewModelItemCode.Equals(property.ViewModelItemCode) && p.Code.Equals(property.Code)))
                return;
            Properties.Add(property);
        }
        public List<ViewModelItemProperty> Properties { get; set; }
    }
}
